/*************************************************************************
	> File Name: P1146.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2024-12-20 15:21:33
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

#define MAX_N 100
bool arr[MAX_N + 5];

int main() {
    int n;
    cin >> n;
    cout << n << endl;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i != j) arr[j] = 1 - arr[j];
            cout << arr[j];
        }
        cout << endl;
    }
    return 0;
}
